﻿@using CAF.WebSite.Mvc.Models.Filter
@using CAF.WebSite.Application.Services.Filter;

@model ArticleFilterModel
@{
    Layout = null;
}

<div class="multi-select-container">
	<form method="GET" action="@Model.Context.Path" class="multi-select-form">
		<input type="hidden" name="pagesize" value="@Model.Context.PageSize" />
		<input type="hidden" name="orderby" value="@Model.Context.OrderBy" />
		<input type="hidden" name="viewmode" value="@Model.Context.ViewMode" />
		<input type="hidden" name="filter" value="@Model.Context.Filter" />
	</form>

	@foreach (var itm in Model.Context.Criteria.Where(c => c.IsInactive).OrderBy(c => c.Value))
	{
		<div class="checkbox-container">
			<label class="checkbox inline ellipsis@(Model.Context.IsActive(itm) ? " highlight" : "")" title="@itm.ToDescription()">
				<input type="checkbox" name="checkFilter@(Model.Context.Criteria.IndexOf(itm))" value="@itm.ToString()"@(Model.Context.IsActive(itm) ? " checked=\"checked\"" : "") />
                @itm.ToDescription() <span class="count">(@itm.MatchCount)</span>
			</label>
		</div>
	}
</div>
